<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap js-check-wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">幻灯片页面管理</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this"><a href="{:url('SlideItem/index',['slide_id'=>$slide_id])}">幻灯片页面列表</a></li>
                                <li><a href="{:url('SlideItem/add',['slide_id'=>$slide_id])}">添加幻灯片页面</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="js-ajax-form layui-form" action="{:url('SlideItem/listOrder')}">
                                        <div>
                                            <button class="layui-btn layui-btn-normal layui-btn-xs js-ajax-submit" type="submit">{:lang('SORT')}</button>
                                        </div>
                                        <php>
                                            $status = [
                                            '隐藏',
                                            '开启'
                                            ];
                                        </php>
                                        <table class="layui-table">
                                            <thead>
                                                <tr>
                                                    <th width="50">{:lang('SORT')}</th>
                                                    <th width="50">ID</th>
                                                    <th>幻灯片标题</th>
                                                    <th>描述</th>
                                                    <th>链接</th>
                                                    <th>图片</th>
                                                    <th>状态</th>
                                                    <th width="160">{:lang('ACTIONS')}</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <foreach name="result" item="vo">
                                                    <tr>
                                                        <td width="50">
                                                            <input name="list_orders[{$vo.id}]" style="width:80px;" type="text" value="{$vo.list_order}">
                                                        </td>
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.title}</td>
                                                        <td>{$description = mb_substr($vo['description'], 0, 48,'utf-8')}</td>
                                                        <td>{$vo.url}</td>
                                                        <td>
                                                            <if condition="!empty($vo['image'])">
                                                                <a href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($vo.image)}');">
                                                                    <i class="fa fa-photo fa-fw"></i>
                                                                </a>
                                                            </if>
                                                        </td>
                                                        <td>{$status[$vo['status']]}</td>
                                                        <td>
                                                            <span class="layui-btn-group">
                                                                <a class="layui-btn layui-btn-xs layui-btn-normal" href="{:url('SlideItem/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                                                <a href="{:url('SlideItem/delete',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs layui-btn-warm js-ajax-delete">{:lang('DELETE')}</a>
                                                                <if condition="empty($vo['status']) eq 1">
                                                                    <a href="{:url('SlideItem/cancelban',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs layui-btn-normal js-ajax-dialog-btn" data-msg="确定显示此幻灯片吗？">{:lang('DISPLAY')}</a>
                                                                    <else />
                                                                    <a href="{:url('SlideItem/ban',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs layui-btn-danger js-ajax-dialog-btn" data-msg="确定隐藏此幻灯片吗？">{:lang('HIDE')}</a>
                                                                </if>
                                                            </span>
                                                        </td>
                                                    </tr>
                                                </foreach>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
</body>

</html>